﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title>招聘管理系统</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link href="/resources/js/plugins/TreeTable/css/jquery.treeTable.css" rel="stylesheet" type="text/css"/>
    <link href="/resources/css/nz.css" rel="stylesheet" type="text/css"/>
    <style>
        .inputform td {
            background: #FFF !important;
            border: none !important;
        }

        .treeTable {
            border: none;
        }
    </style>
</head>
<body onload="initView()">
<div id="loader"><img alt="" src="/resources/image/1d_2.gif"/></div>
<div id="main">
    <div class="position">当前位置：<a href="/NZ/">人才招聘</a> > 员工登录</div>
    <div style="width:320px;margin:100px auto;">
        <form id="loginform" method="post" action="/NZ/LoginAction">
            <table class="treeTable inputform">
                <tbody>
                <tr>
                    <td>员工号：</td>
                    <td>
                        <div><input type="text" value="03575" name="ucode" datatype="*" nullmsg="员工号不能为空！"/></div>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td width="60">验证码：</td>
                    <td width="150">
                        <div><input type="password" name="vcode" datatype="*" nullmsg="验证码不能为空！"/></div>
                    </td>
                    <td><a href='javascript:' class='validlink'>发送手机验证码</a></td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>
                        <button type="submit">马上登录</button>
                    </td>
                    <td></td>
                </tr>
                </tbody>
            </table>
        </form>
    </div>
</div>
<script src="/resources/js/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="/resources/js/plugins/Validform/Validform_v5.3.2_min.js" type="text/javascript"></script>
<script src="/resources/js/plugins/layer2.0/layer.js" type="text/javascript"></script>
<script src="/resources/js/actions.js" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#loginform").Validform({
            ajaxPost: true,
            callback: function (data) {
                if (data.url != 'no') {
                    $.Showmsg(data.Message + ' 马上跳转...');
                } else {
                    $.Showmsg(data.Message);
                }
                setTimeout(function () {
                    if (data.state) {
                        $.Hidemsg();
                    }
                    if (data.url != 'no') {
                        location = data.url;
                    }
                }, 2000);
            }
        });

        $('.validlink').click(function () {
            var ucode = $('input[name=ucode]').val();
            if (ucode.length > 0) {
                postAjax('/NZ/SendVCode?ucode=' + ucode, null, function (data) {
                    $.Showmsg(data.Message);
                });
            } else {
                $.Showmsg("请输入员工号");
            }
        });
    });

    function postAjax(url, parm, callBack) {
        var load = null;
        $.ajax({
            type: 'post',
            dataType: "json",
            url: url,
            data: parm,
            cache: false,
            async: true,
            beforeSend: function (e) {
                load = layer.load('努力加载中...');
            },
            error: function () {
                layer.close(load);
                $.Showmsg('连接服务器失败！');
            },
            success: function (msg) {
                layer.close(load);
                callBack(msg);
            }
        });
    }
</script>
</body>
</html>